
var _XheList;

const Status = [
    { "key": "1", "value": "使用", "defaulted": "true" },
    { "key": "0", "value": "作废" }
];

$(function () {
    bind();
    search();
});

var bind = function () {
    try {
        document.getElementById("spn_view_title").innerHTML = PROJECTNAME;
        Template.init("temp_template");
        OptionUtil.bind("ddl_S_Status", "key", "value", Status, false, null, "");
    }
    catch (e) { }
}

var init = function () {

    _XheList = new XheList();
    //_SearchModel.Methed = "DataCenterGet_1_0";
    _XheList.model.TableID = "tbl_Data";
    _XheList.model.ModalID = "div_Modal";
    _XheList.model.Title = "";
    _XheList.model.Table = "t_data_template";
    _XheList.model.SortName = "tempid";
    _XheList.model.SortOrder = "desc";
    _XheList.model.PrimaryKey = "tempid";
    _XheList.model.Button.Show = "编辑";
    _XheList.model.Button.Info = "预览";
    _XheList.model.Checked = false;
    _XheList.model.Number = true;
};

// 展示列表数据
var search = function () {

    try {
        init();

        _XheList.model.Columns = [
            ["tempname", "模板名称", "15", "", "C", "", true],
            ["tempremark", "模板描述", "35", "", "C", "", true],
            ["tempcreatetime", "创建时间", "12", "", "D", "", true],
            ["tempusername", "创建人", "10", "", "C", "", true],
            ["tempstatus", "状态", "10", "", "C", Status, true],
            ["tempid", "操作", "10", "null", "I", "", true]
        ];

        _XheList.search();
    } catch (e) {
        alert(e);
    }
};

var info = function (model, value, row, index) {
    try {

        if (row.tempid != undefined && row.tempid != null) {
            jumpUrl("UI-HBGJ", row.tempid, "template");
        }
    }
    catch (e) {
        alert(e);
    }
};

var save = function () {
    try {

        _XheList.edit();
    }
    catch (e) {
        alert(e);
    }
}















